<?php

class CHCPlotPie extends CHCPlotLine
{
    public function __construct()
    {
        parent::__construct();
        $this->m_sType = 'pie';
    }
    
    
    /**
     *  The center of the pie chart relative to the plot area. 
     *  
     *  Can be percentages or pixel values. 
     *  
     *  Defaults to array('50%', '50%');
     *  
     * @param Array $pasArray
     */
    public function setCenter($pasArray=array('50%', '50%'))
    {
        if (CSDebug::assertArray($pasArray)) return false;
        
        $this->setParam('center', $pasArray);
    }
    
    
    /**
     *  Whether each legend item should refer to a "point" or a "series". 
     *  
     *  Defaults to "point".
     *  
     * @param $psString
     */
    public function setLegendType($psString='point')
    {
        if (!in_array($psString, array('point', 'series'))) return false;
        
        $this->setParam('legendType', $psString);
    }
    
    
    /**
     *  The diameter of the pie relative to the plot area. 
     *  Can be a percentage or pixel value. 
     *  
     *  Defaults to "90%".
     *  
     * @param $psString
     */
    public function setSize($psString='90%')
    {
        if (!in_array($psString, array('point', 'series'))) return false;
        
        $this->setParam('size', $psString);
    }
    
    
    /**
     * If a point is sliced, moved out from the center, how many pixels should it be moved? 
     *  
     * Defaults to 10.
     *  
     * @param $pnInteger
     */
    public function setLicedOffset($pnInteger=10)
    {
        if (CSDebug::assertInteger($pnInteger, true)) return false;
        
        $this->setParam('slicedOffset', $pnInteger);
    }
    
 
}

?>